Repository navigation
Make --fail-on an enum, now argh compiles its default - #82
Merged
Merged
Conversation
--fail-on was a string checked against a list by hand, because argh could not compile an enum parameter defaulting to a member that is not 0 (nullean/argh#75). Argh 0.30.1 can, so --fail-on is SuggestedVersionChange: help lists its values and argh rejects others. The hidden diff keeps its string --prevent-change unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Mpdreamz
force-pushed
the
typed-fail-on
branch
from
November 14, 2026 08:47
76f7b47 to
327dea6
Compare
Mpdreamz
added a commit
that referenced
this pull request
Nov 14, 2026
`pull-request --fail-on major` fails the check on a breaking change, labels it `breaking`, and says in the comment that adding `breaking-allowed` lets it through. Once someone adds the label, the next run passes. **Prompt summary:** The GitHub Action should set the `breaking` label, and it should also allow a configurable allow label. The flow: a library author makes a breaking change, assembly-differ detects it, applies `breaking` and fails. The author applies the allow label, the workflow runs again, and it succeeds. ## Why `pull-request` labelled a breaking change but could not hold it back. Failing on it took `--fail-on` on the comparison step, which knows nothing about labels, so an intended break failed every run until someone loosened the workflow. ## What #### The labels decide the gate `pull-request` now reads the pull request's labels before it writes anything. With `--fail-on major`, a `Major` suggestion fails with exit code `4` unless the pull request has the allow label. The default is `breaking-allowed`, and `--allow-label` renames it. A change below `--fail-on` passes as before. The release label is set either way, so `breaking` stays on the pull request after the break is allowed. #### The comment says what to do A blocked change opens the comment with a caution: the check fails, and adding `breaking-allowed` allows it if the change is intended. An allowed change gets a note that the label allows it. The console says the same. #### Runs without labels Outside a pull request there are no labels, so `--fail-on` applies as it does on the other commands. A read-only token, as on a pull request from a fork, can still read the labels, so the gate works there too; only the comment and label writes are skipped, with a warning. ## Verify ```bash mise run test # PullRequestTests: Fails_a_breaking_change_until_the_allow_label_is_added runs the whole flow against FakeGitHub ``` The workflow has to run on the `labeled` and `unlabeled` pull request events, so adding the label runs the check again; the README says so, and the GitHub Action pull request sets it up. **Stack:** 2 of 2, on top of [#82](#82). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
--fail-onis now theSuggestedVersionChangeenum.--helplistsnone|patch|minor|major, and argh rejects any other value. This needs Nullean.Argh 0.30.1.Prompt summary: argh 0.30.1 shipped the enum default fix from nullean/argh#151 so that assembly-differ's options could be typed. This takes it.
Why
An enum parameter whose default member was not
0did not compile with argh before 0.30.1 (nullean/argh#75).SuggestedVersionChange.Noneis1, so--fail-onwas a string with[AllowedValues]and a hand-writtenEnum.Parse.What
A typed option
ReportOptions.FailOnis aSuggestedVersionChangethat defaults toNone. The commands pass it straight to the comparison. Argh matches values case-insensitively, asEnum.Parsedid.diffunchangedThe hidden
diffkeeps its string--prevent-changeand its error for an unknown value, because its output is part of the contract. The characterization snapshots for it do not change.Verify
Only the help snapshots change.
🤖 Generated with Claude Code